In computing, a serial communication physical interface is often referred to as a serial port through which information transfers in or out one bit at a time (in contrast to a parallel port with multiple bits in parallel). Throughout most of the history of computers, data has been transferred through serial ports to devices such as modems, terminals, and various peripherals. The term “serial port” has historically identified hardware more or less compliant to the RS-232 standard, intended to interface with a modem or with a similar communication device. However, interfaces such as Ethernet, FireWire, and universal serial bus (USB) all send data as a serial stream as well. Serial ports are still used in applications such as industrial automation systems, scientific instruments, point of service (POS) systems and some industrial and consumer products. Server computers may use a serial port as a control console for diagnostics. Network equipment (such as routers and switches) often use a serial console for configuration. Serial ports are still used in these areas as they are simple, low cost, and their console functions are highly standardized and widespread. A serial port requires very little supporting software from the host system. A serial communications (COM) port is a driver interfacing with a universal asynchronous receiver and transmitter (UART) and provides certain interface semantics for reading, writing, flow control, and timing.
A virtual serial port is an emulation of the standard serial port. This port is created by software which enables extra serial ports in an operating system (OS) without additional hardware installation (such as expansion cards or the like). It is possible to create a large number of virtual serial ports in a computing device. The only limitation is the amount of resources, such as operating memory and computing power, needed to emulate many serial ports at the same time. Virtual serial ports emulate all hardware serial port functionality, including baud rate, data bits, parity bits, stop bits, and the like. Additionally, serial ports allow controlling the data flow, emulating all signal lines (DTR/DSR/CTS/RTS/DCD/RI) and customizing pinouts. Virtual serial ports are common with Bluetooth™ and are the standard way of receiving data from BLUETOOTH™-equipped global positioning system (GPS) modules.
Virtual serial communications (COM) port emulation can be useful in the scenario there is a lack of available physical serial ports or they do not meet the current requirements. For instance, virtual serial ports can share data between several applications from one GPS device connected to a serial port. Another option is to communicate with any other serial devices via internet or local area network (LAN) as if they are locally connected to computer (Serial over LAN/Serial-over-Ethernet technology). Two computers or applications can communicate through an emulated serial port link. Virtual serial port emulators are available for many operating systems including MACOS™, LINUX™, and various mobile and desktop versions of MICROSOFT WINDOWS™ operating systems.
In many modern operating systems, software programs, applications or processes can execute in user mode or kernel mode. In kernel mode, a program can interact with the OS directly and may cause certain events (e.g., timers, keyboard, hard disk I/O, or the like), and these events are called interrupts. When an interrupt occurs, the central processing unit (CPU) essentially stops executing the currently running program, and switches to kernel mode, executing the interrupt handler for that event. The handler saves the state of the CPU performs some processing relevant to that event, and restores the state of the CPU (possibly switching back to user mode) so the CPU can resume execution of the program. As a result of operating in kernel mode the computer system may be error prone and subject to context switching which negatively impacts performance. In user mode, however, programs cannot modify paging directly and so have no way of accessing other program's memory except through an application programming interface (API) function. Programs in user mode also cannot interfere with interrupts and context switching of other programs. Typical virtual serial COM port emulators interface and execute by communicating with the OS via an API in kernel mode. Operating in kernel mode exposes the computer system to be more vulnerable to bugs, errors and slower performing in general. For at least these reasons, there is a need for improved systems and methods for implementing a user mode virtual serial communications port emulator.